﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LoungeRepo.Contracts.Core;
using LoungeRepo.Core;

namespace Basics
{
    class Program
    {
        static void Main(string[] args)
        {
            using(ILoungeRepository repo = new LoungeRepository())
            {
                var her = new Person { Id = "1", Name = "Mary", City = "Boston" };
                var him = new Person { Id = "2", Name = "John", City = "Seattle", Spouse=her };
                her.Spouse = him;
                repo.Store(him);

                var p = repo.Load<Person>("2", "Persons");
                Console.WriteLine(p);
                Console.WriteLine(p.Spouse);


                him = new Person { Id = "3", Name = "Michael", City = "Dallas" };
                repo.Store(him);

                p = repo.Load<Person>("3", "Persons");
                Console.WriteLine(p);
            }
        }
    }
}
